import request from '@/utils/request'

export default {
  //请求列表
  getTeacherList(current, size, query) {
    if (!(typeof (current) == "number"))
      current = 1
    if (!(typeof (size) == "number"))
      size = 10
    return request({
      url: "/eduservice/teacher/pageConditionTeacher/" + current + "/" + size,
      method: 'get',
      params:query
    })
  },
  //请求老师的id和name的映射
  getNameAndIdMapper(){
    return request({
      url: "/eduservice/teacher/getAllNameAndIdMapper",
      method: 'get'
    })
  },
  delTeacherById(id){
    return request({
      url: `/eduservice/teacher/${id}`,
      method: "delete"
    })
  },
  addOrupdateTeacher(teacher){
    return request({
      url: "/eduservice/teacher/addOrupdateTeacher",
      method: "post",
      data: teacher
    })
  },
  getTeacherById(id){
    return request({
      url: `/eduservice/teacher/getTeacher/${id}`,
      method: "get",
    })
  }
}

